***********************************
**  Replication Files Guideline
**
**  Institutionalized Police Brutality
**  Torture, the Militarization of Security
**  and the Reform of Inquisitorial Criminal Justice in Mexico
**********************************

This file provides information for the replication files for the paper Institutionalized Police Brutality. 
It describes the tables and figures in the paper, the files that contain the scripts that produce them,
and the dataset used to generate them.


***************
*****TABLES****
***************

TABLE 1
-File: R_tables_figures.R
-Dataset: final_dataset.dta
-Description: Implementation dates for the state-level Code of Criminal Procedure. States with asterisks --
		which did not implement the reform by pure geographic logic and thus were not considered in the 
		examination of the state reforms -- are imputed by hand from the acts of state congresses that
		outlined the timetable for reform.

TABLE 2: Abuses reported by prisoners
-File: R_tables_figures.R
-Dataset: final_dataset.dta
-Description: The table reports overall rates of different forms of abuse considered in developing the metrics of
		institutionalized torture, brute force, and threats alongside some other abuses reported in the survey.
		Information is presented about whether this occurred prior to arrival at the Public Ministry or
		at the Public Ministry itself. 

TABLE 3
-File: R_tables_figures.R
-Dataset: final_dataset.dta
-Description: This table reports levels of abuse by arresting authority, level of custody, crime, sex, education,
		indigenous language, and age at arrest.

TABLE 4
-File: R_tables_figures.R
-Dataset: final_dataset.dta
-Description: This table shows reported rates of abuse by conviction status. 

TABLE 5
-File: R_tables_figures.R
-Dataset: final_dataset.dta
-Description: This table reports a simple difference in averages for levels of reported abuse prior to the reform 
		and after the reform's implementation.

TABLE 6
-File: models_paper.do
-Dataset: final_dataset.dta
-Description: The table reports the diff-in-diff results for the effect of the reform
		on torture, beatings, and threats. 

TABLE 7
-File: Table_7.R
-Dataset: final_dataset.dta
-Description: This table contains a mediation analysis following Imai et al (2011) and Imai and Yamamoto (2013) 
		to examine whether imbalances in posttreatment covariates -- arrests by municipal police 
		and arrests for theft -- are driving the results. 

TABLE 8
-File: models_paper.do
-Dataset: final_dataset.dta
-Description: Reports various placebo tests that were run on the period prior to the implementation of 
		the reform.

TABLE 9
-File: models_paper.do
-Dataset: final_dataset.dta
-Description: This table presents results from the diff-in-diff model run on the effect of joint operations 
		on torture. It further contains models that examine the effect of turf wars, federal prisons, 
		and the levels of law enforcement authority on torture during this period. Analogous models 
		are presented in the Appendix for brute force and threats. 

TABLE 10
-File: models_paper.do
-Dataset: final_dataset.dta
-Description: Reports various placebo tests that were run on the period prior to the implementation of 
		joint operations. 

TABLE 11
-File: models_paper.do
-Dataset: final_dataset.dta
-Description: Reports various heterogenous effects of the reform on torture -- organized crime threats
		and authorities carrying out arrests.


****************
*****FIGURES****
****************

FIGURE 1: Structural topic models for jurisprudential theses
-File: stm_tesis_penal.R
-Dataset: TJ_subset_dates_penal.tsv
-Description: This figure shows the prevalence of different topics in Supreme Court
		jurisprudence on matters of criminal law. stm_tesis_penal.R produces the plots for
		all the topic models. The figure in the main text is cleaned up 
		using code in graph_topics.do which takes data from tesis_jurisprudencial.dta, 
		which is generated from the model produced in stm_tesis_penal.R

FIGURE 2: Turf wars
-This figure draws on publicly available data from SINAIS and shows municipalities experiencing
		extreme violence. The calculation of turf wars was obtained from Magaloni and Robles (2020).


FIGURE 3: Year of arrest and types of abuse
-File: models_paper.do
-Dataset: final_dataset.dta
-Description: The figure shows predicted rates of abuse and 95% 
		confidence intervals over time using a simple OLS
		with year fixed effects.

FIGURE 4
-File: models_paper.do
-Dataset: final_dataset.dta
-Description: This figure uses leads and lags of the treatment to show the way that covariates of 
		interest -- crimes likely associated with organized crime and the proportion of 
		arrests from different authorities in the sample -- change around the reform.


**************************
**APPENDIX
**************************

*SECTION 3

TABLE A1
-File: appendix.do
-Dataset: final_dataset.dta
-Description: This table provides simple descriptive statistics on the education levels and employment histories
		of respondents in the sample.

*SECTION 4.1

TABLE A2
-File: appendix.do
-Dataset: final_dataset.dta
-Description: Full table of coefficients for Table 6 in the main text. Presents diff-in-diff results for 
		the criminal justice reform.


TABLE A3
-File: appendix.do
-Dataset: final_dataset.dta
-Description: Full table of coefficients for diff-in-diff results on the effect of the reform using 
		logit rather than OLS. 

*SECTION 4.2

TABLE A4
-File: appendix.do
-Dataset: final_dataset.dta
-Description: Presents diff-in-diff results using months rather than years as the unit of time for the 
		analysis.

TABLE A5
-File: R_tables_figures.R
-Dataset: final_dataset.dta
-Description: Presents diff-in-diff results using the municipality-month average rate of reported abuse
		as the dependent variable. 

*SECTION 4.3

TABLE A6
-File: R_tables_figures.R
-Dataset: final_dataset.dta
-Description: Presents composition of pre- and post-reform sample along a range of relevant covariates. 

TABLE A7
-File: matching.do
-Dataset: final_dataset.dta
-Description: This table reports the results of coarsened exact matching on crimes, jurisdiction in which 
		they are being held (federal or state), their sentencing status, and age.

*SECTION 4.4

TABLE A8
-File: appendix.do
-Dataset: final_dataset.dta
-Description: This table presents diff-in-diff results for the reform from regressions 
		iteratively dropping observations from each state. The table includes
		federal as well as state prisoners. 


TABLE A9
-File: appendix.do
-Dataset: final_dataset.dta
-Description: This table presents diff-in-diff results for the reform from regressions 
		iteratively dropping observations from each state. The table includes
		only state prisoners. 

*SECTION 4.5

FIGURE A1
-File: appendix.do
-Dataset: final_dataset.dta
-Description: This figure shows leads and lags of the reform treatment for the three
		primary dependent variables.


TABLE A10
-File: appendix.do
-Dataset: final_dataset.dta
-Description: This table reports results from models with unit-specific time trends. The models
		are estimated four times: once on the full sample, once with data beginning in 2008 
		(accounting for the full period when the reform had passed), once with data beginning 
		in 2013 (accounting for the change in national policy with the turnover in administrations), 
		and once on the full dataset and using fixed effects for each unique month, rather than using
		year fixed effects.


TABLE 11
-File: appendix.do
-Dataset: final_dataset.dta
-Description: This table reports results from models for the effect of the reform with state-year fixed 
		effects.		

TABLE 12
-File: R_tables_figures.R
-Dataset: final_dataset.dta
-Description: This table presents the date of announcement used in the placebo tests using announcement dates.

TABLE 13
-File: appendix.do
-Dataset: final_dataset.dta
-Description: This table presents the full set of covariates for the placebo test that uses the announcement of 
		the timetable for implementing the reformed code of criminal procedure.

*SECTION 4.6

FIGURE A2
-File: appendix.do
-Dataset: final_dataset.dta
-Description: The figure shows the predicted incidence of torture by levels of state capacity and impunity
		using a measure of capacity derived from size of the local judicial bureaucracy
		obtained from the census of municipal governments and the ``cifra negra'' which
		is an estimate of unreported crimes at the state level.

TABLES 14-16
-File: appendix.do
-Dataset: final_dataset.dta
-Description: These tables present a discussion of the heterogenous effect of the reform based on 
		two measures of state capacity -- the first is the size of the local judicial bureaucracy
		obtained from the census of municipal governments and the second is the ``cifra negra'' which
		is an estimate of unreported crimes at the state level.

TABLES A17-A18
-File: appendix.do
-Dataset: final_dataset.dta
-Description: These tables present anaolgous regressions for brute force and threats 
		to the heterogenous effects of the criminal justice reform that are presented 
		in Table 11 of the main text.

*SECTION 4.7

TABLES A19-A20
-File: appendix.do
-Dataset: final_dataset.dta
-Description: Tables present leads and lags from the models in Figure 4 of the main text.

SECTION 5

TABLE A21
-File: N/A
-Dataset: N/A
-Description: Dates of the beginning of joint operations during the term of President Felipe Calderon 
		(12/2006 - 12/2012). Compiled by hand from Atuesta (2018). Full citation in the appendix.


TABLE A22
-File: appendix.do
-Dataset: final_dataset.dta
-Description: This table presents the diff-in-diff results for joint operations with unit-level time trends. 
		The model is run twice: first using the full sample prior to 2013 and again using the sample 
		from 2001-2013 (the onset of democracy through the end of the Calderon presidency).

FIGURES A3-A5
-File: R_tables_figures.R
-Dataset: final_dataset.dta
-Description: These figures distinguish between states that received joint operations and those that did not 
		receive joint operations. The figures plot trends over time in torture, brute force, and 
		threats among these two groups showing that the trend in physical abuse among 
		states that did and did not receive joint operations were comparable prior to the beginning of 
		Felipe Calderon's drug war.

TABLES A23-A24
-File: appendix.do
-Dataset: final_dataset.dta
-Description: These tables present anaolgous regressions for brute force and threats 
		to the heterogenous effects of the joint operations that are presented 
		in Table 9 of the main text.

SECTION 6
-File: stm_tesis_penal.R
-Dataset: TJ_subset_dates_penal.tsv
-Description: This section of the appendix provides topic models of jurisprudential theses. 
		It provides additional detail on the model presented in the main text of the paper
		as well as results from additional models presented for robustness.
		The code to estimate all models and produce all the tables and plots in Section 6 
		is contained in the indicated R file. 

*SECTION 7

FIGURE A12
-File: appendix.do
-Dataset: final_dataset.dta
-Description: Predicted margins for Model 4 in each of Tables 9, 11, A15, A16, A23, and A24.

FIGURES A9-A11; FIGURES A13-A18
-File: benjamini-hochberg script.R, appendix.do
-Dataset: final_dataset.dta
-Description: These figures show the Benjamini-Hochberg procedure for controlling the false discovery rate
		for the models in Figure A12 and Model 4 in each of Tables 9, 11, A15, A16, A23, and A24. Models estimated 
		in appendix.do; p-values copied and plotted in R.













